<script setup>
import { ref } from 'vue'
import { Delete, Edit } from '@element-plus/icons-vue'
const getJobVisible = ref(false)
const getJobForm = ref({
  name: '',
  age: '',
  education: '',
  experience: '',
  position: ''
})
// import { Switch } from '@element-plus/icons-vue'
const tableData = [
  {
    date: '2016-05-03',
    name: 'Tom',
    address: 'No. 189, Grove St, Los Angeles'
  },
  {
    date: '2016-05-02',
    name: 'Tom',
    address: 'No. 189, Grove St, Los Angeles'
  },
  {
    date: '2016-05-04',
    name: 'Tom',
    address: 'No. 189, Grove St, Los Angeles'
  },
  {
    date: 'JAVA开发岗',
    name: '湖南-长沙',
    address: '2016-05-01-2016-05-03'
  }
]
</script>

<template>
  <el-card class="box-card">
    <template #header>
      <div class="card-header">
        <span class="header-title">我的招聘信息</span>
        <el-button
          type="primary"
          round
          style="float: right"
          @click="getJobVisible = true"
          >发布招聘信息
        </el-button>
      </div>
    </template>
    <el-table :data="tableData" stripe style="width: 100%">
      <el-table-column
        prop="date"
        label="岗位名称"
        align="center"
        width="180"
      />
      <el-table-column prop="name" label="地址" align="center" width="180" />
      <el-table-column prop="address" label="薪资" align="center">
        <template #default="{ row }"> 5000-10000 </template></el-table-column
      >
      <el-table-column prop="address" label="状态" align="center">
        <template #default="{ row }">
          <el-tag type="success">已发布</el-tag>
        </template>
      </el-table-column>
      <el-table-column
        prop="address"
        label="最近修改时间"
        show-overflow-tooltip
      />
      <el-table-column prop="address" label="操作" align="center">
        <template #default="{ row }">
          <el-button-group>
            <el-button type="primary" size="mini" :icon="Edit"></el-button>
            <el-button type="danger" size="mini" :icon="Delete"></el-button>
          </el-button-group>
        </template>
      </el-table-column>
    </el-table>
  </el-card>
  <el-dialog v-model="getJobVisible" title="发布求职信息">
    <template #footer>
      <el-form :model="getJobForm">
        <el-form-item label="岗位名称">
          <el-input v-model="getJobForm.job"></el-input>
        </el-form-item>
        <el-form-item label="工作地址">
          <el-input v-model="getJobForm.address"></el-input>
        </el-form-item>
        <el-form-item label="期望薪资">
          <el-row>
            <el-col :span="7">
              <el-input v-model="getJobForm.pay_min" placeholder="最低薪资">
              </el-input>
            </el-col>
            <el-col :span="2" style="text-align: center; font-weight: bold">
              -
            </el-col>
            <el-col :span="7">
              <el-input v-model="getJobForm.pay_max" placeholder="最高薪资">
              </el-input>
            </el-col>
          </el-row>
        </el-form-item>
        <el-form-item label="对公司的要求">
          <el-input type="textarea" v-model="getJobForm.condition"></el-input>
        </el-form-item>
      </el-form>
      <span class="dialog-footer">
        <el-button @click="getJobVisible = false">取消</el-button>
        <el-button type="primary" @click="getJobVisible = false">
          发布
        </el-button>
      </span>
    </template>
  </el-dialog>
</template>

<style scoped></style>
